const pkg = require("./package.json");

const env = process.argv[3].split("=")[1];
const environment = {
  production: "正式版",
  development: "测试版",
};
const version = `${pkg.version}-${environment[env]}`;
const appArtifactName = `${pkg.description}_${version}.exe`;

module.exports = {
  appId: pkg.name,
  asar: true,
  directories: {
    output: `release/${pkg.version}/${environment[env]}`,
  },
  files: ["dist", "dist-electron"],
  productName: pkg.description,
  win: {
    icon: "build/icons/icon.ico",
    target: [
      {
        target: "nsis",
        arch: ["x64"],
      },
    ],
    artifactName: appArtifactName,
    requestedExecutionLevel: "requireAdministrator",
  },
  nsis: {
    oneClick: false,
    perMachine: false,
    allowToChangeInstallationDirectory: true,
    deleteAppDataOnUninstall: false,
  },
};
